import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 公益包领取信息 */
export interface CharityPackage {
          applicantName: string; // 申请人姓名
          applicantMobile: string; // 申请人手机号
          idCard: string; // 身份证号
          detailedAddress: string; // 详细地址
          expressCompany: string; // 快递公司
          expressNumber: string; // 快递单号
          shipTime: string | Dayjs; // 发货时间
  }

// 公益包领取 API
export const CharityPackageApi = {
  // 查询公益包领取分页
  getCharityPackagePage: async (params: any) => {
    return await request.get({ url: `/mcm/charity-package/page`, params })
  },

  // 查询公益包领取详情
  getCharityPackage: async (id: number) => {
    return await request.get({ url: `/mcm/charity-package/get?id=` + id })
  },

  // 新增公益包领取
  createCharityPackage: async (data: CharityPackage) => {
    return await request.post({ url: `/mcm/charity-package/create`, data })
  },

  // 修改公益包领取
  updateCharityPackage: async (data: CharityPackage) => {
    return await request.put({ url: `/mcm/charity-package/update`, data })
  },

  // 删除公益包领取
  deleteCharityPackage: async (id: number) => {
    return await request.delete({ url: `/mcm/charity-package/delete?id=` + id })
  },

  /** 批量删除公益包领取 */
  deleteCharityPackageList: async (ids: number[]) => {
    return await request.delete({ url: `/mcm/charity-package/delete-list?ids=${ids.join(',')}` })
  },

  // 导出公益包领取 Excel
  exportCharityPackage: async (params) => {
    return await request.download({ url: `/mcm/charity-package/export-excel`, params })
  },
}